﻿<!--
 Peter
 Created by: Peter Development Team
    http://peter.codeplex.com/
 
 GNU General Public License version 2 (GPLv2)
    http://peter.codeplex.com/license
 
 This code is provided on an AS IS basis, with no WARRANTIES,
  CONDITIONS or GUARANTEES of any kind.
-->
<UserControl x:Class="Peter.View.ViewZipExplorer"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"
             xmlns:Logic="clr-namespace:Peter.Logic"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             d:DataContext="{d:DesignInstance Logic:ModelZipExplorer}">
   <Grid>
      <Grid.Resources>
         <xcdg:DataGridCollectionViewSource x:Key="_ZipItems"
                                            Source="{Binding Path=ZipItems}">
            <xcdg:DataGridCollectionViewSource.GroupDescriptions>
               <PropertyGroupDescription PropertyName="DirPath" />
            </xcdg:DataGridCollectionViewSource.GroupDescriptions>
         </xcdg:DataGridCollectionViewSource>
         <Style TargetType="{x:Type xcdg:GroupByControl}">
            <Setter Property="AllowGroupingModification"
                    Value="False" />
            <Setter Property="Visibility"
                    Value="Collapsed" />
         </Style>
      </Grid.Resources>
      
      <xcdg:DataGridControl ItemsSource="{Binding Source={StaticResource _ZipItems}}"
                            IsTextSearchEnabled="True">
         <xcdg:DataGridControl.Columns>
            <xcdg:Column FieldName="FileName"
                         Title="File" />

            <xcdg:Column FieldName="CompressedSize"
                         Title="Compressed Size" />
            
            <xcdg:Column FieldName="RealSize"
                         Title="Uncompressed Size" />

            <xcdg:Column FieldName="CompressionMethod"
                         Title="Compression Method" />

            <xcdg:Column FieldName="DirPath"
                         Title="Directory Path" />

            <xcdg:Column FieldName="ZipObject"
                         Visible="False" />
         </xcdg:DataGridControl.Columns>
      </xcdg:DataGridControl>
   </Grid>
</UserControl>
